"""
    支付管理
"""
import time

from Page.Page1 import Page1
from selenium.webdriver.common.by import By

class Page2(Page1):
    # 支付管理
    PaymentManagement_lco = (By.XPATH,'//*[@id="sidebar"]/div[2]/div[7]/h2')
    # 支付管理信息
    PaymentManagement_message_lco = (By.XPATH,'//*[@id="sidebar"]/div[2]/div[8]/ul/li[1]/div/a')
    # 添加支付产品信息
    PaymentManagement_add_loc = (By.CLASS_NAME,'add')
    # 输入产品编码 productCode
    productCode_loc = (By.XPATH,'//*[@id="navTab"]/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[1]/dd/input')
    # 输入支付产品名称 productName
    productName_lco = (By.XPATH,'//*[@id="navTab"]/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[2]/dd/input')
    # 提交
    Submit_button_loc = (By.XPATH,'//*[@id="navTab"]/div[2]/div[3]/div/form/div[2]/ul/li[1]/div/div/button')
    def PaymentManagement(self):
        self.click(self.PaymentManagement_lco,3)

    def PaymentManagement_message(self):
        self.click(self.PaymentManagement_message_lco,20)

    def PaymentManagement_add(self):
        self.click(self.PaymentManagement_add_loc,2)

    def productCode(self):
        self.input_text(self.productCode_loc,'10',2)

    def productName(self):
        self.input_text(self.productName_lco,'西瓜',2)

    def Submit_button(self):
        self.click(self.Submit_button_loc)

    def add_logguo_product(self):
        self.login_longguo_001()
        self.PaymentManagement()
        time.sleep(3)
        self.PaymentManagement_message()
        time.sleep(3)
        self.PaymentManagement_add()
        self.productCode()
        time.sleep(3)
        self.productName()
        time.sleep(3)
        self.Submit_button()
        time.sleep(3)
